package com.example.shortmessage.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    public static String dateToString(Long longs, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);//日期格式
        Date date = new Date(longs);
        String time = "";
        try {
            time = sdf.format(date);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return time;
    }
}
